package com.ccb.sc.common.conf;

import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.annotation.PostConstruct;

/**
 * @author ken
 * @version 1.0
 * @date 2020-09-22
 */
@ConfigurationProperties(prefix = "aliyun.oss")
public class OssProperties {

    private String accessKeyId;
    private String accessKeySecret;
    private String endpoint;
    private String bucket;

    private String cdnHost;

    public static OssProperties ossProperties = new OssProperties();

    @PostConstruct
    public void init() {
        ossProperties.setAccessKeyId(accessKeyId);
        ossProperties.setAccessKeySecret(accessKeySecret);
        ossProperties.setBucket(bucket);
        ossProperties.setEndpoint(endpoint);
        ossProperties.setCdnHost(cdnHost);
    }

    public String getAccessKeyId() {
        return accessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId = accessKeyId;
    }

    public String getAccessKeySecret() {
        return accessKeySecret;
    }

    public void setAccessKeySecret(String accessKeySecret) {
        this.accessKeySecret = accessKeySecret;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getBucket() {
        return bucket;
    }

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    public String getCdnHost() {
        return cdnHost;
    }

    public void setCdnHost(String cdnHost) {
        this.cdnHost = cdnHost;
    }
}
